<?php 
/////////////////////////////////////////////////////////////////////////////
// 这个文件是 网城创想多用户商城 项目的一部分
//
// Copyright (c) 2007 - 2008 www.shopnc.net
//
// 要查看完整的版权信息和许可信息，请查看源代码中附带的 COPYRIGHT 文件，
// 或者访问 http://www.shopnc.net/ 获得详细信息。
/////////////////////////////////////////////////////////////////////////////

/**
 * FILE_NAME : statics_product.manage.php   FILE_PATH : \system\statics_member.manage.php
 * ....会员信息统计
 *
 * @copyright Copyright (c) 2007 - 2007 www.shopnc.net 
 * @author 网城创想多用户商城开发团队 php_netproject@yahoo.com.cn
 * @package 
 * @subpackage 
 * @version Mon Dec 10 16:46:59 CST 2007
 */
require_once("../global.inc.php");

class SysStaticsVisit extends SystemFrameWork{
	/**
	 * 验证对象
	 *
	 * @var obj
	 */
	var $objvalidate;
	/**
	 * 访问统计对象
	 *
	 * @var obj
	 */
	var $obj_visit;
	

	function main(){
		/**
		 * 创建统计对象
		 */
		if (!is_object($this->obj_visit)){
			require_once("statics.class.php");
			$this->obj_visit = new StaticsClass();
			$this->obj_visit->StaticsClassStruct();
		}
		/**
		 * 创建验证对象
		 */
		if (!is_object($this->objvalidate)){
			require_once("commonvalidate.class.php");
			$this->objvalidate = new CommonValidate();
		}

		/**
		 * 设置模板路径
		 */
		$this->setsubtemplates("system");

		/**
		 * 语言包
		 */
		$this->getlang("product");

		
		switch ($this->_input['action']){
			case "list":
				$this->_liststatics();
				break;
			default:
				$this->_liststatics();
				break;
		}

	}
	/**
	 * 访问统计首页列表
	 *
	 */
	function _liststatics(){
		/**
		 * 创建统计对象
		 */
		if (!is_object($this->obj_visit)){
			require_once("statics.class.php");
			$this->obj_visit = new StaticsClass();
			$this->obj_visit->StaticsClassStruct();
		}
		$start_date = $this->obj_visit->getStartDate();
		$today_ipnum = $this->obj_visit->getIpNum();
		$today_pvnum = $this->obj_visit->getPvNum();
		$total_days = $this->obj_visit->getDayNum();
		$highest_ipnum = $this->obj_visit->getMaxIpNum();
		$highes_pvnum = $this->obj_visit->getMaxPvNum();
		$total_ipnum = $this->obj_visit->getIpNumSum();
		$total_pvnum = $this->obj_visit->getPvNumSum();
		
		$ip_array = $this->obj_visit->getIpArray();
		foreach($today_pvnum as $value){
			$output_today_pvnum += $value;
		}
		/**
		 * 输出到页面模板
		 */
		$this->output("start_date", $start_date);
		$this->output("today_ipnum", $today_ipnum);
		$this->output("today_pvnum", $output_today_pvnum);
		$this->output("total_days", $total_days);
		$this->output("highest_ipnum", $highest_ipnum);
		$this->output("highes_pvnum", $highes_pvnum);
		$this->output("total_ipnum", $total_ipnum);
		$this->output("total_pvnum", $total_pvnum);
		$this->output("ip_array", $ip_array);
		$this->showpage("sys_statics_visit.manage");
	}

}

$statics_visit = new SysStaticsVisit();
$statics_visit->main();
unset($statics_visit);

?>